<template>
	<view class="padding" :class="ishot?'u-border margin':'u-border-bottom'" @tap="handleClick">
		<view class="flex justify-between">
			<view class="fs-30">
				{{jobdata.jobname}}
				<u-tag v-if="jobdata.cfytype==1" text="实习" mode="plain" size="mini" type="warning"/>
				<u-tag v-else text="兼职" mode="plain" size="mini" type="success"/>
			</view>
			<view class="fs-24 color-yellow">
				{{jobdata.salary}}/月
			</view>
		</view>
		<view class="margin-tb-xs">
			<u-tag 
				v-for="(item,index) in jobdata.welfare"
				:key="index"
				:text="wefareList[item]" 
				mode="dark" 
				bg-color="#d8d8d8"
				size="mini"
				class="margin-right-xs"
			/>
		</view>
		<view class="flex justify-between">
			<view class="text-cut">
				<u-icon name="map-fill" color="#d8d8d8"></u-icon>
				{{jobdata.address}}
			</view>
			<view class="">
				100km
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"JobItem",
		props:{
			ishot:{
				type:Boolean,
				default:false
			},
			jobdata:{
				type:Object,
				required:true
			}
		},
		data() {
			return {
				wefareList:[
					'',
					'下午茶',
					'绩效奖金',
					'五险一金',
					'寒暑假',
					'团建金',
				]
			};
		},
		methods:{
			handleClick(){
				this.$emit('myclick')
				// uni.navigateTo({
				// 	url:'JobDetail'
				// })
			}
		}
	}
</script>

<style lang="scss">
.u-border.margin{
	border-radius: 10upx;
}
</style>
